package com.etooling.pdm.entity;


import com.etooling.framework.svo.AbstractEntity;
import lombok.Data;

import javax.persistence.*;

/**
 * 产品属性值
 */
@Entity
@Data
@Table(name = "t_goods_prop_values", schema = "pdm")
public class GoodsPropValues extends AbstractEntity {
    GoodsType goodsType;
    GoodsPropSetting goodsPropSetting;
    Goods goods;//产品
    String value;
    String code;


    @ManyToOne(targetEntity = GoodsType.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "goods_type_id")
    public GoodsType getGoodsType() {
        return goodsType;
    }

    @ManyToOne(targetEntity = GoodsPropSetting.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "setting_id")
    public GoodsPropSetting getGoodsPropSetting() {
        return goodsPropSetting;
    }

    @ManyToOne(targetEntity = Goods.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "goods_id")
    public Goods getGoods() {
        return goods;
    }

    @Deprecated
    @Transient
    GoodsTypeProperties goodsTypeProperties;//属性
    @Deprecated
    @Transient
    String pValue;//值
    @Deprecated
    @Transient
    GoodsSpecs goodsSpecsValue;//保存规格的id

    @Transient
    public GoodsTypeProperties getGoodsTypeProperties() {
        return goodsTypeProperties;
    }

    @Transient
    public void setGoodsTypeProperties(GoodsTypeProperties goodsTypeProperties) {
        this.goodsTypeProperties = goodsTypeProperties;
    }

    @Transient
    public String getpValue() {
        return pValue;
    }

    @Transient
    public void setpValue(String pValue) {
        this.pValue = pValue;
    }

    @Transient
    public GoodsSpecs getGoodsSpecsValue() {
        return goodsSpecsValue;
    }

    @Transient
    public void setGoodsSpecsValue(GoodsSpecs goodsSpecsValue) {
        this.goodsSpecsValue = goodsSpecsValue;
    }
}
